﻿using Assets.Scenes.Script;
using Newtonsoft.Json;
using SimpleTools;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;

public static class ConfigReader 
{
    public static readonly string CSVPATH;
    public static ConfigItem[] configs;
    static ConfigReader()
    {
        CSVPATH = AppDomain.CurrentDomain.BaseDirectory + @"\";
        

        #if UNITY_EDITOR
            CSVPATH = "D://xxx/";;
        #endif

        var str =FileHelp.GetStringData(CSVPATH + "config.json");

        try
        {
            configs = JsonConvert.DeserializeObject<ConfigItem[]>(str);
        }
        catch (Exception ex)
        {
            UIManager.Single.output.text = ex.Message+"\r\n"+ex.StackTrace;
            throw;
        }
        
        
    }


}
